package com.aspose.cells;

import java.util.Comparator;

class zbnr implements Comparator {
   private zql a;
   private Cells b;

   zbnr(zql var1, Cells var2) {
      this.a = var1;
      this.b = var2;
   }

   public int compare(Object x, Object y) {
      boolean var3 = this.a.b() == 0;
      switch(this.a.d()) {
      case 0:
         zbns var4 = (zbns)x;
         zbns var5 = (zbns)y;
         if (var5.d > 0) {
            if (var4.d == var5.d) {
               return 0;
            } else if (var4.d < 0) {
               return var3 ? 1 : -1;
            } else {
               if (var4.d < var5.d) {
                  return var3 ? -1 : 1;
               }

               return var3 ? 1 : -1;
            }
         } else if (var4.d > 0) {
            return var3 ? -1 : 1;
         } else if (var4.c == var5.c) {
            switch(var4.a) {
            case 0:
               if ((Boolean)var4.b == (Boolean)var5.b) {
                  return 0;
               } else {
                  if ((Boolean)var4.b) {
                     return var3 ? 1 : -1;
                  }

                  return var3 ? -1 : 1;
               }
            case 1:
            case 3:
            default:
               return 0;
            case 2:
               return 0;
            case 4:
               return var3 ? com.aspose.cells.b.a.zn.a((Double)var4.b, (Double)var5.b) : com.aspose.cells.b.a.zn.a((Double)var5.b, (Double)var4.b);
            case 5:
               return var3 ? ((String)var4.b).compareTo((String)var5.b) : ((String)var5.b).compareTo((String)var4.b);
            }
         } else {
            if (var4.c < var5.c) {
               return var3 ? -1 : 1;
            }

            return var3 ? 1 : -1;
         }
      default:
         return 0;
      }
   }
}
